package com.fzk.utils;

import java.util.List;
import java.util.Map;

/**
 * 集合工具，如List、Set
 *
 * @author uestcfzk
 * @date 2025-02-22 22-38-14
 */
public class MyCollectionUtil {
    public static boolean isEmpty(List<?> list) {
        return list == null || list.isEmpty();
    }

    public static boolean isOneEmpty(List<?>... list) {
        for (List<?> a : list) {
            if (a == null || a.isEmpty()) return true;
        }
        return false;
    }

    public static boolean isAllEmpty(List<?>... list) {
        for (List<?> a : list) {
            if (!isEmpty(a)) return false;
        }
        return true;
    }

    public static boolean allNotEmpty(List<?>... list) {
        for (List<?> a : list) {
            if (a == null || a.isEmpty()) return false;
        }
        return true;
    }

    public static <T> T getFromMap(Map<String, T> map, String key) {
        return map == null ? null : map.get(key);
    }
}
